home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="iso-8859-1"?> <dialog width="400" height="380" caption="Unordered list"> <controls> <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone"> <panel name="pnlMain" caption="" align="altop" taborder="0" hint="" width="383" height="56" top="1" left="1" bevelinner="bvnone" bevelouter="bvnone"> <label name="lblItemCount" caption="Number of items" hint="" width="29" height="13" top="16" left="8"/> <label name="lblType" caption="Type" hint="" width="56" height="13" top="16" left="190"/> <combobox name="comType" taborder="1" text="" hint="Select the type of items your list should use." width="170" height="21" top="32" left="190"> <items> circle square disc </items> </combobox> <spinedit name="speItemCount" taborder="0" hint="Choose how many items you want in your list." maxvalue="100" minvalue="1" value="1" width="170" height="20" top="32" left="8"> <event type="onchange"> stgItems.RowCount := speItemCount.Value+1; </event> </spinedit> </panel> <panel name="pnlList" caption="" align="altop" taborder="1" hint="" width="383" height="143" top="57" left="1" bevelinner="bvnone" bevelouter="bvnone"> <label name="lblItems" caption="List elements" hint="" width="81" height="13" top="8" left="8"/> <stringgrid name="stgItems" left="8" top="23" width="353" height="104" rowcount="2" colcount="2" fixedcols="1" fixedrows="1" ctl3d="0" defaultcolwidth="20" defaultrowheight="15"/> </panel> </panel> </controls> <dialogevents> <event type="onclose" resulttype="ok"> StartCode := '<ul'; If comType.Text <> '' then StartCode := StartCode + ' type="'+comType.Text+'"'; If edtCSSClass.Text <> '' then StartCode := StartCode + ' class="'+edtCSSClass.Text+'"'; If edtCSSId.Text <> '' then StartCode := StartCode + ' ID="'+edtCSSId.Text+'"'; If edtCSSStyle.Text <> '' then StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"'; for i := 0 to EventGrid.Count - 1 do begin if EventGrid.Rows[i].EditText <> '' then StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"'; end; StartCode := StartCode + '>'; EndCode := #13#10; for i := 1 to stgItems.RowCount - 1 do EndCode := EndCode + (#9+'<li>' + stgItems.Cells[1,i] + '</li>'+#13#10); EndCode := EndCode + '</ul>'; If cbMakeXHTMLCompliant.Checked then StartCode := MakeXHTMLCompliant(StartCode, true); If cbDoPHPEscape.Checked then StartCode := DoPHPEscape(StartCode); // A little "hack" - WebCoder will set this, to let us know whether to update // an existing tag, or insert a brand new one If cbUpdateExistingTag.Checked then ReplaceTag(StartCode) else InsertTags(StartCode+EndCode, ''); </event> <event type="onshow"> // Specific for this dialog stgItems.ColWidths[1] := stgItems.Width - stgItems.ColWidths[0]; stgItems.Options := [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing]; If cbUpdateExistingTag.Checked then begin pnlList.Visible := false; Self.Height := Self.Height-pnlList.Height; speItemCount.Enabled := false; end; // Lets put the advanced panel in the right place pnlAdvanced.Parent := MainPanel; pnlAdvanced.Left := 8; pnlAdvanced.Top := MainPanel.Height - 32; pnlAdvanced.Width := Self.Width - 36; // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel? If pnlAdvanced.Height > 20 then Self.Height := Self.Height + 200; Self.ActiveControl := MainPanel; MainPanel.SetFocus; </event> <event type="updatedialog"> // This event will be called when a user executes the "Edit current tag"-rightclick feature // The entire selected tag will be passed as a parameter to this function, that should update // the required fields of the dialog. function UpdateDialog(Tag: string); begin comType.Text := GetValueFromAttribute(Tag, 'type'); edtCSSClass.Text := GetValueFromAttribute(Tag, 'class'); edtCSSId.Text := GetValueFromAttribute(Tag, 'id'); edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style'); for i := 0 to EventGrid.Count - 1 do begin EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption)); If EventVal <> '' then EventGrid.Rows[i].EditText := EventVal; end; cbDoPHPEscape.Checked := IsPHPEscaped(Tag); cbMakeXHTMLCompliant.Checked := isXHTMLDocument(); end; </event> </dialogevents> </dialog>